home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in.2</name>
- <id>-1</id>
- <cardCount>1</cardCount>
- <cardID>3037</cardID>
- <listID>2335</listID>
- <cantModify><false /></cantModify>
- <cantDelete><false /></cantDelete>
- <cantAbort><false /></cantAbort>
- <cardSize>
- <width>416</width>
- <height>296</height>
- </cardSize>
- <script>on openStack
- global noAS
- if the heapSpace < 600000 then
- beep
- answer "HyperCard's memory partition is set too low."&return&¬
- "Quit HyperCard, select the HyperCard icon and choose Info from the File menu."&&¬
- "Set the memory partition in the Info window to 3000 kB." with "Quit"
- set lockErrorDialogs to true
- doMenu "Quit HyperCard"
- exit openStack
- end if
- if the version < 2.3 then
- beep
- answer "You don't have the right version of HyperCard (Player). Use version 2.3 or higher."
- set lockErrorDialogs to true
- doMenu "Quit HyperCard"
- exit openStack
- end if
- push this cd
- cleanUp
- if char 1 of GetMode() is not "B" then
- AddColor install,16
- put the result into thisResult
- hide bg btn id 5
- else
- put empty into thisResult
- show bg btn id 5
- end if
- put WriteReadPrefs("read","HTML Optimizer Preferences") into prefs
- if prefs contains "Can't find file" then
- put "installed" into btn id 65
- put WriteReadPrefs("write","HTML Optimizer Preferences","installed") into this
- else put "moved" into btn id 65
- put false into noAS
- lock screen
- CheckStatus prefs
- hide btn id 49
- AddColor colorCard,barnDoorOpen,25
- unlock screen with barn door open fast
- do btn id 5
- checkcolor thisResult
- if last word of cd fld "About…" is a number then delete last word of cd fld "About…"
- initialize
- checkRepeat
- pass openStack
- end openStack
-
- on closeStack
- if freeSize of this stack > 2500 and the cantModify of this stack is false
- then doMenu "Compact Stack"
- enableThings
- reset menuBar
- if hilite of btn id 49 is false then set hilite of btn id 49 to true
- lock screen
- prepareIntro
- show btn id 49
- FullBalloons "off"
- AddColor remove
- pass closeStack
- end closeStack
-
- on resumeStack
- cleanUp
- pass resumeStack
- end resumeStack
-
- on suspendStack
- reset menuBar
- FullBalloons "off"
- pass suspendStack
- end suspendStack
-
- on cleanUp
- if visible of msg then hide msg
- if visible of tool window then hide tool window
- if visible of pattern window then hide pattern window
- reset menuBar
- put "About HTML Optimizer…" into menuItem 1 of menu 1 with menuMsg "aboutOptimizer"
- if number of menuItems of menu "File" > 7 then
- put number of menuItems of menu "File" into n
- repeat with i = n-2 down to 7
- delete menuItem i of menu "File"
- end repeat
- delete menuItem 1 of menu "File"
- end if
- if there is a menu "Edit" then delete menu "Edit"
- if there is a menu "Go" then
- if number of menuItems of menu "Go" > 4 then
- repeat until number of menuItems of menu "Go" is 2
- delete last menuItem of menu "Go"
- end repeat
- end if
- end if
- if there is a menu "Style" then delete menu "Style"
- if there is a menu "Font" then delete menu "Font"
- if there is a menu "Tools" then delete menu "Tools"
- if there is a menu "Objects" then delete menu "Objects"
- if there is a menu "Color" then delete menu "Color"
- if there is not a menu "Configure" then create menu "Configure"
- put "Define Location for Optimizer Output Folder…,Confirm Standard Internet Browser,-,About this Menu…"¬
- into menu "Configure" with menuMsg "config1,config2,,aboutConfig"
- if rect of cd fld "BlueLine" is not "16,185,400,187" then set rect of cd fld "BlueLine" to "16,185,400,187"
- if rect of cd fld "SmallBlueLine1" is not "17,52,154,55" then set rect of cd fld "SmallBlueLine1" to "17,52,154,55"
- if rect of cd fld "SmallBlueLine2" is not "260,52,395,55" then set rect of cd fld "SmallBlueLine2" to "260,52,395,55"
- if cd fld "storePath" is not in long name of this stack then
- buttonStyles
- put empty into btn id 26
- put empty into btn id 42
- put empty into btn id 115
- end if
- disable btn id 115
- put long name of this stack into stackPath
- set the itemDelimiter to colon
- delete word 1 of stackPath
- delete char 1 of stackPath
- delete last item of stackPath
- put ":" after stackPath
- put stackPath into btn id 71
- set the itemDelimiter to comma
- if short name of btn id 5 is "Hide Info" then send mouseUp to btn id 5
- set scroll of cd fld "Intro" to 0
- if the systemVersion < 8.5 then
- set textStyle of word 1 to 2 of cd fld "Welcome" to bold
- else set textStyle of word 1 to 2 of cd fld "Welcome" to plain
- end cleanUp
-
- on aboutOptimizer
- lock screen
- set textSize of line 2 of cd fld "About…" to 14
- set textStyle of line 2 of cd fld "About…" to bold
- set textSize of line 4 of cd fld "About…" to 12
- set textSize of line 6 of cd fld "About…" to 10
- show cd fld "About…"
- AddColor colorCard,irisOpen,15
- unlock screen with iris open fast
- wait 15
- if the mouseClick then exitAbout
- lock screen
- put "Checks all tagged pairs" into line 4 of cd fld "About…"
- AddColor colorCard,barndoorclose,40
- unlock screen with iris open fast
- wait 15
- if the mouseClick then exitAbout
- lock screen
- put "Marks all dangling tags" into line 4 of cd fld "About…"
- AddColor colorCard,barndoorclose,40
- unlock screen with iris open fast
- wait 15
- if the mouseClick then exitAbout
- lock screen
- put "Converts special characters" into line 4 of cd fld "About…"
- AddColor colorCard,barndoorclose,40
- unlock screen with iris open fast
- wait 15
- if the mouseClick then exitAbout
- lock screen
- put "Optimizes your web pages" into line 4 of cd fld "About…"
- AddColor colorCard,barndoorclose,40
- unlock screen with iris open fast
- wait 15
- if the mouseClick then exitAbout
- lock screen
- put "Copyright (1999-2000) Ton Brand" into line 4 of cd fld "About…"
- AddColor colorCard,barndoorclose,40
- unlock screen with barn door close
- wait 15
- if the mouseClick then exitAbout
- lock screen
- hide cd fld "About…"
- AddColor colorCard,irisClose,20
- unlock screen with iris close fast
- send mouseUp to this cd
- end aboutOptimizer
-
- on exitAbout
- lock screen
- hide cd fld "About…"
- send mouseUp to this cd
- unlock screen
- exit to HyperCard
- end exitAbout
-
- on buttonStyles
- if systemFont() is Chicago then
- repeat with i = 1 to number of btns
- set textFont of btn i to Chicago
- set textStyle of btn i to plain
- end repeat
- else if systemFont() is Charcoal then
- repeat with i = 1 to number of btns
- set textFont of btn i to Charcoal
- set textStyle of btn i to plain
- end repeat
- else
- repeat with i = 1 to number of btns
- set textFont of btn i to Geneva
- set textStyle of btn i to bold,condense
- end repeat
- end if
- if char 1 of GetMode() is "B" then
- set hilite of btn "ProgressBase" to true
- set style of btn "Optimize…" to default
- set style of btn "Save" to default
- set height of btn "Optimize…" to 26
- set height of btn "Save" to 26
- else
- set hilite of btn "ProgressBase" to false
- set style of btn "Optimize…" to transparent
- set style of btn "Save" to transparent
- set height of btn "Optimize…" to 18
- set height of btn "Save" to 18
- end if
- end buttonStyles
-
- on disableThings
- lock screen
- hide cd fld "Intro"
- hide cd fld "BlueLine"
- disable btn "Quit"
- disable btn "Print…"
- disable btn "Optimize…"
- disable btn "Check Tags…"
- disable btn "Mark Tags…"
- disable btn "Convert…"
- disable btn "Preferences…"
- disable btn "View Page"
- disable btn id 5
- hideThings
- hideThings
- AddColor colorCard,stamp,0
- unlock screen
- end disableThings
-
- on enableThings
- lock screen
- show cd fld "Intro"
- show cd fld "BlueLine"
- enable btn "Quit"
- enable btn "Print…"
- enable btn "Optimize…"
- enable btn "Check Tags…"
- if "unregistered" is not in cd fld "About…" then enable btn "Mark Tags…"
- enable btn "Convert…"
- enable btn "Preferences…"
- enable btn "Not Yet"
- enable btn "Register…"
- enable btn id 5
- if visible of cd fld "Prefs" then send mouseUp to btn "Cancel"
- if visible of btn id 109 then send mouseUp to btn id 109
- hideThings
- AddColor colorCard,stamp,0
- unlock screen
- end enableThings
-
- on hideThings
- hide cd fld "Status"
- hide cd fld "Progress"
- hide cd fld "Log"
- hide btn "ProgressBase"
- if visible of cd fld "About" then
- hide cd fld "About"
- set name of btn id 5 to "Author Info"
- end if
- end hideThings
-
- on hidePrefs
- hide cd fld "Prefs"
- hide cd fld "Fake1"
- hide cd fld "Fake2"
- hide cd fld "Fake3"
- hide cd fld "Fake4"
- hide cd fld "Fake5"
- hide cd fld "SmallBlueLine1"
- hide cd fld "SmallBlueLine2"
- hide btn id 28
- hide btn id 29
- hide btn id 30
- hide btn id 34
- hide btn id 35
- hide btn id 37
- hide btn id 38
- hide btn id 39
- hide btn id 44
- hide btn id 53
- hide btn id 60
- hide btn id 61
- hide btn id 68
- hide btn id 96
- hide btn id 119
- hide btn id 127
- AddColor removeObject,cd,26
- end hidePrefs
-
- on checkColor thisResult
- if "Error" is in thisResult then
- beep
- answer "Color is missing because HyperCard's memory partition is set too low."&return&¬
- "Quit HyperCard and when in the Finder, select the HyperCard icon and increase"&&¬
- "HyperCard's memory partition via Info from the File menu." with "Cancel","Quit"
- if it is "Quit" then doMenu "Quit HyperCard"
- end if
- end checkColor
-
- on initialize
- if cd fld "storePath" is not in long name of this stack then
- put long name of this stack into temp
- delete word 1 of temp
- delete char 1 of temp
- delete last char of temp
- set the itemDelimiter to colon
- put item 1 of temp &":"& item 2 of temp into cd fld "storePath"
- set the itemDelimiter to comma
- send mouseUp to btn "Default"
- if the cantModify of this stack is false then
- if the systemVersion < 7.5 then
- beep
- answer "Your system version is lower than 7.5."&return&"You may not be able to go"&&¬
- "online from HTML Optimizer."
- end if
- disable btn id 83
- disable btn id 84
- disableThings
- send mouseUp to btn "Welcome"
- send mouseUp to btn "chooseFolderPath"
- enable btn id 83
- enable btn id 84
- enableThings
- else
- beep
- answer "Sorry, you can't run this program from CD-ROM. It will quit now."
- doMenu "Quit HyperCard"
- end if
- end if
- end initialize
-
- on config1
- Fullballoons "isOn"
- if the result then Fullballoons "Off"
- send mouseUp to btn "selectFolderPath"
- if btn id 26 is empty then
- answer folder "Select a folder in which you want the Optimizer Output folder."&¬
- return&"When done, go to the Finder and make the Optimizer Output folder in that location."&return&return
- if the result is "Cancel" then
- exit to HyperCard
- else put it into btn id 26
- end if
- end config1
-
- on config2
- put empty into btn id 115
- if the systemVersion < 8.5 then
- put "Internet Config" into text1
- else put "the control panel Internet" into text1
- answer "HTML Optimizer will use your standard Internet browser as set in"&&text1&"."
- end config2
-
- on aboutConfig
- answer "If you wish to change the location of the Optimizer Output folder"&&¬
- "or re-confirm it after an error message, or if you wish to confirm a different standard"&&¬
- "Internet browser, then you need to choose the appropriate menu command from the Configure menu."
- end aboutConfig
-
- on mouseWithin
- FullBalloons "isOn"
- if not the result then
- set hilite of btn "Balloon Help" to false
- else set hilite of btn "Balloon Help" to true
- FullBalloons "isShowing"
- if not the result and the mouseLoc is within the rect of the target then send mouseEnter to the target
- end mouseWithin
-
- on idle
- global showLog,thisSelect
- if visible of cd fld "Status" then put true into showLog
- if not enabled of btn "Quit" then enableThings
- if showLog is true then
- if "Stopped by user" is not in cd fld "Log" then
- put return&return&"Stopped by user." after cd fld "Log"
- if not enabled of btn "View Page" and thisSelect is "one" then
- put "The log is in the Optimizer Output folder." into line 3 to 4 of cd fld "Log"
- end if
- end if
- if not visible of cd fld "Log" then
- show cd fld "Log"
- disable btn "Print…"
- put false into showLog
- saveLog
- end if
- end if
- pass idle
- end idle
-
- on saveLog
- global whatLog
- if not hilite of btn id 44 then checkLogSize whatLog
- put cd fld "Log"&return&"-------------------------------------------------------"&¬
- return into tempLog
- put whatLog&&the short date&&"Γùè"&&the long time&return into line 1 to 3 of tempLog
- if hilite of btn id 44 then
- WriteToFile tempLog,true,btn id 26&"Optimizer Output:"&whatLog,false,ttxt
- else WriteToFile tempLog,true,btn id 26&"Optimizer Output:"&whatLog,true,ttxt
- if word 1 of the result contains "Error" then
- put the result into theResult
- errorMessage theResult
- end if
- end saveLog
-
- on checkLogSize whatLog
- open file btn id 26&"Optimizer Output:"&whatLog
- if the result is empty then
- read from file btn id 26&"Optimizer Output:"&whatLog until eof
- put it into thisLog
- close file btn id 26&"Optimizer Output:"&whatLog
- if length of thisLog > 29000 then
- beep
- answer "The "&whatLog&" in your Optimizer Output folder approaches its 32K limit."&¬
- return&"Do you want to clear it before you store new data?" with "Clear Log","Not Yet"
- if it is "Clear Log"
- then WriteToFile "",true,btn id 26&"Optimizer Output:"&whatLog,false,ttxt
- end if
- end if
- end checkLogSize
-
- on errorMessage theResult,thisPage
- global noAS
- if thisPage is empty then
- put "the log" into thisPage
- else put quote&thisPage"e into thisPage
- beep
- if 120 is in theResult then
- put "Could not find the folder ""e&"Optimizer Output""e&" at the location <"&¬
- btn id 26&">."&return&"Please make this folder and select the same"&&¬
- "web page of folder again." into errMsg
- if length of errMsg > 254 then
- repeat until length of errMsg = 254
- delete last char of errMsg
- end repeat
- put "…" into last char of errMsg
- end if
- if noAS is true then -- AppleScript has not worked
- answer "Could not find the folder ""e&"Optimizer Output""e&"."&return&¬
- "Please go to the Finder and make this folder in HTML Optimizer's parent folder."&¬
- return&return&"(HyperCard will quit)"
- lock screen
- hideThings
- prepareIntro
- show btn id 49
- FullBalloons "off"
- doMenu "Quit HyperCard"
- exit to HyperCard
- else
- answer errMsg
- end if
- set the itemDelimiter to colon
- put last item of btn id 26 into btn id 42
- set the itemDelimiter to comma
- answer folder "In which folder must ""e&"Optimizer Output""e&" be placed?"&return&¬
- "(your earlier choice was ""e&btn id 42"e&")"&return&return
- if the result is "Cancel" then exit to HyperCard
- put it into btn id 26
- if button id 26 Γëá empty then
- send mouseUp to btn "makeFolder"
- send mouseUp to the target
- end if
- enableThings
- exit to HyperCard
- else if 49 is in theResult then
- answer "Could not save"&&thisPage&&"because the existing file is in use."
- else if 37 is in theResult then
- answer "Could not save"&&thisPage&&"because its name is too long."
- else if 35 is in theResult then
- put item 1 of btn id 26 into thisVolume
- delete last char of thisVolume
- answer "Could not save"&&thisPage&&"because the volume ""e&thisVolume&¬
- quote&&"was not found."&return&"Tip: Move HTML Optimizer to another location and re-start it."&¬
- return&return&"(HyperCard will quit)"
- lock screen
- hideThings
- prepareIntro
- show btn id 49
- FullBalloons "off"
- doMenu "Quit HyperCard"
- exit to HyperCard
- else answer "Sorry, an error has occurred while saving"&&thisPage&"."&return&return&theResult
- end errorMessage
-
- on returnKey
- if not visible of msg then
- if visible of cd fld "Prefs" then
- click at loc of btn "Save"
- else click at loc of btn "Optimize…"
- else pass returnKey
- end returnKey
-
- on enterKey
- if not visible of msg then
- if visible of cd fld "Prefs" then
- click at loc of btn "Save"
- else click at loc of btn "Optimize…"
- else pass enterKey
- end enterKey
-
- on keyDown key
- if the optionKey is down then
- if key Γëá tab then
- pass keyDown
- end if
- else pass keyDown
- end keyDown
-
- on AC_Transitions
- end AC_Transitions
-
-
-
- </script>
- <background id="2606" file="background_2606.xml" name="" />
- <card id="3037" file="card_3037.xml" marked="false" name="" owner="2606" />
- </stack>
-